// JavaScript Document
 


function gain(c){ //获取对象
 if(typeof(c) == "string")
 return document.getElementById(c);
 return c;
}
function openLoginBg(state){ //遮照打开关闭控制
 if(state == 1)
 {
  gain("bg").style.display = "block";
  var h = document.body.clientHeight > document.documentElement.clientHeight ? document.body.clientHeight : document.documentElement.clientHeight;
// alert(document.body.offsetHeight);
 //alert(document.documentElement.offsetHeight);
  gain("bg").style.height = h + "px";
 }
 else
 {
  gain("bg").style.display = "none";
 } 
}
function openLoginSelect(state){ //选择城市层关闭打开控制
 if(state == 1) 
 {
  gain("login_formbox").style.display = "block";
  gain("login_formbox").style.left = (gain("bg").offsetWidth - gain("login_formbox").offsetWidth)/2 + "px";
  gain("login_formbox").style.top =document.body.scrollTop +  document.documentElement.scrollTop + 100 + "px";  
 }
 else
 {
  gain("login_formbox").style.display = "none";
 }
}

